package com.txts.road.app.system.model.dto;

import java.io.Serial;
import java.io.Serializable;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.*;

/**
 * 版本更新表单对象
 *
 * @author baoyanrong
 * @since 2025-07-17 13:34
 */
@Getter
@Setter
@Schema(description = "版本更新表单对象")
public class AppVersionDTO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "版本ID")
    @NotNull(message = "版本ID不能为空")
    private Long id;

    @Schema(description = "版本名称")
    @NotBlank(message = "版本名称不能为空")
    @Size(max=50, message="版本名称长度不能超过50个字符")
    private String versionName;

    @Schema(description = "版本号")
    @NotNull(message = "版本号不能为空")
    private Integer versionCode;

    @Schema(description = "平台：1-Android，2-iOS")
    @NotNull(message = "平台：1-Android，2-iOS不能为空")
    private Integer platform;

    @Schema(description = "下载地址")
    @Size(max=500, message="下载地址长度不能超过500个字符")
    private String downloadUrl;

    @Schema(description = "更新内容")
    @Size(max=65535, message="更新内容长度不能超过65535个字符")
    private String updateContent;

    @Schema(description = "是否强制更新：0-否，1-是")
    private Integer isForceUpdate;

    @Schema(description = "文件大小(字节)")
    private Long fileSize;

    @Schema(description = "发布时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime releaseTime;

    @Schema(description = "创建时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;


}
